module MEM_MUX (
    input load_mode_en,
    input [7:0] load_addr,
    input [15:0] load_datain,
    input load_we,
    input [7:0] cpu_addr,
    input [15:0] cpu_datain,
    input cpu_we,
    output reg mem_we,
    output reg [7:0] mem_addr,
    output reg [15:0] mem_datain
);
    always @(*) begin
        if (load_mode_en) begin//下载模式，fifo给内存
            mem_addr = load_addr;
            mem_datain = load_datain;
            mem_we = load_we;
        end else begin //cpu模式，cpu给内存
            mem_addr = cpu_addr;
            mem_datain = cpu_datain;
            mem_we = cpu_we;
        end
    end

    
endmodule